/*
 * $Id$
 */
package corejs.stmt;

import corejs.rt.ActivationRecord;
import corejs.expr.Expression;

import corejs.util.XmlPrinter;

/**
 *
 * @author myang
 */
public class If extends Statement {

   private Expression _test;
   private Statement _if;
   private Statement _else;

   public Expression test() {
      return _test;
   }

   public If test(final Expression test) {
      _test = test;
      return this;
   }

   public Statement iff() {
      return _if;
   }

   public If iff(final Statement ifTrue) {
      _if = ifTrue;
      return this;
   }

   public Statement els() {
      return _else;
   }

   public If els(final Statement or) {
      _else = or;
      return this;
   }

   @Override
   public void accept(final StatementVisitor visitor) {
      visitor.visitIf(_test, _if, _else);
   }
}
